﻿using Script.UI;
using Script.UI.Component;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using MTUnity.Utils;

public class UI_Histogram_Repertory : UI_Histogram<HistogramData_Repertory>
{

    public HistogramDisplay Histogram_DisplayInterface;
    public Text Txt_TotalRepertory;
    public Text Txt_RepertoryInBuffRatio;
    public Text Txt_RepertoryInStoreRatio;
    public Text Txt_Time;
    // Start is called before the first frame update
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }

   
    protected override void OnRefresh()
    {
        DateTime dt = TimeUtil.FromTimestamp(Data.Timestamp);
        Txt_Time.text = dt.Day.ToString();
        int iTotalRepertory = (int)(Data.Current + Data.Current2);
        Txt_TotalRepertory.text = iTotalRepertory.ToString();
        Txt_RepertoryInBuffRatio.text = ((int)((Data.Current / iTotalRepertory) * 100)).ToString();
        Txt_RepertoryInStoreRatio.text = ((int)(100 - (Data.Current / iTotalRepertory) * 100)).ToString();
        Histogram_DisplayInterface.SpecificMaxValue = (int)(Data.Current + Data.Current2);
        Histogram_DisplayInterface.SpecificMinValue = (int)Data.Min;
        Histogram_DisplayInterface.CurrentValue = (int)Data.Current;
    }
}